using System;

using Storyteller.Framework.Math;

namespace Storyteller.Framework.Graphics
{
	public struct AnimationEvent
	{
		public bool Complete { get; set; }
		public bool EventAvailable { get; set; }
		public string EventName { get; set; }
	}
	
	public abstract class AnimationPlayer
	{
		public string CurrentAnimationName { get; protected set; }
		public string TransitionAnimationName { get; protected set; }
		
		public AnimationPlayer()
		{
			CurrentAnimationName = "";
			TransitionAnimationName = "";
			inTransition = false;
		}
		
		public void Start(string name)
		{
			Start(name, false);
		}

		public abstract void Start(string name, bool allowRestart);
		public abstract void Transition(string name, float transitionTime);
		
		public abstract AnimationEvent Update(float deltaSeconds);
		public abstract AnimationEvent SetTime(float seconds);
		
		public abstract void Draw(SpriteBatch spriteBatch, Vector2 position, Color color, float rotation, Vector2 scale, bool flipHorizontal, bool flipVertical);
		
		protected bool inTransition;
	}
}

